<% requirements ||= '' %>
<% @license_names << project.normalize_licenses %>
<li>
  <% if version %>
    <%= link_to project, version_path(version.to_param) %>
    -
    <%= link_to version.number, version_path(version.to_param), class: 'tip', title: 'Resolved version' %>
    -
  <% else %>
    <%= project %> -
  <% end %>
  <em class='text-muted'>
    <span class="tip" title="Specified version range"><%= requirements %></span>
    <%= '-' if requirements.present? %>
    <%= project.normalize_licenses.join(', ') %>
  </em>
  <% if dependency %>
    <%= render 'dependencies/flags', dependency: dependency %>
  <% end %>
  <% if version %>
    <% kind = index.zero? ? @kind : 'runtime' %>
    <% dependencies = version.dependencies.kind(kind).includes(project: :versions).limit(100) %>
    <% if dependencies.length > 0 %>
      <ul>
        <%dependencies.each do |dependency| %>
          <% if dependency.project && index < 10 && !@project_names.include?(dependency.project_name) %>
            <% @project_names << dependency.project_name %>
            <%= render partial: 'tree/dependency', locals: {project: dependency.project, version: dependency.latest_resolvable_version, requirements: dependency.requirements, dependency: dependency, index: index + 1} %>
          <% else %>
          <li>
            <%= link_to dependency.project_name, project_path(platform: dependency.platform.downcase, name: dependency.project_name) %>
            <span class="tip text-muted" title="Specified version range"><%= dependency.requirements %></span>
          </li>
          <% end %>
        <% end %>
      </ul>
    <% end %>
  <% end %>
</li>
